package com.collect.zambia.zhiAdater.zhiCustomerOrder;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.collect.zambia.R;
import com.collect.zambia.zhiBean.zhiReceive.ZHIRCustomerRepayMarkedListEntity;

public class ZHICustomerMarkedAdjuster extends BaseQuickAdapter<ZHIRCustomerRepayMarkedListEntity, BaseViewHolder> {

    public ZHICustomerMarkedAdjuster() {
        super(R.layout.item_customer_marked_order_list, null);
    }

    private OnCTCustomerMarkedAdjusterItemClickListener mOnCTCustomerMarkedAdjusterItemClickListener;

    @Override
    protected void convert(BaseViewHolder helper, ZHIRCustomerRepayMarkedListEntity item) {
        helper.setText(R.id.tv_orderId, item.getOrderId());
        helper.setText(R.id.tv_name, item.getFullName());
        helper.setText(R.id.tv_mobile, item.getMobile());
        helper.setText(R.id.tv_type, item.getType());
        helper.setText(R.id.tv_product, item.getProduct());
        helper.setText(R.id.tv_follow_time, item.getFollowTime());
        helper.setText(R.id.tv_remark, "Remark: " + item.getRemark());

        helper.addOnClickListener(R.id.ll_content);

        if (mOnCTCustomerMarkedAdjusterItemClickListener != null) {
            helper.getView(R.id.rl_content).setOnClickListener(view -> mOnCTCustomerMarkedAdjusterItemClickListener.OnItemClick(item));
        }
    }

    public void setOnCTCustomerMarkedAdjusterItemClickListener(OnCTCustomerMarkedAdjusterItemClickListener mOnCTCustomerMarkedAdjusterItemClickListener) {
        this.mOnCTCustomerMarkedAdjusterItemClickListener = mOnCTCustomerMarkedAdjusterItemClickListener;
    }

    public interface OnCTCustomerMarkedAdjusterItemClickListener {
        void OnItemClick(ZHIRCustomerRepayMarkedListEntity zhirCustomerRepayMarkedListEntity);
    }
}
